import java.io.BufferedReader;
import java.io.IOException;

/**
 * 客户端接收线程
 */

public class ReThread implements Runnable{

    private BufferedReader br;

    public ReThread(BufferedReader br) {
        this.br = br;
    }

    @Override
    public void run() {
        try {
            String line = null;
            while((line = br.readLine())!=null){
                System.out.println(line);    //打印此客户机收到的信息
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(br != null){
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
